use std::cmp::Ordering;
use std::io;
fn main() {
    println!("请输入一个数:");
    let mut guess = String::new();
    io::stdin().read_line(&mut guess).expect("读取失败");
    println!("你输入的是:{}", guess);
    let num = 10;
    match guess.trim().parse::<i32>() {
        Ok(f) => match f.cmp(&num) {
            Ordering::Less => print!("{}太小", guess),
            Ordering::Greater => println!("{}太大", guess),
            Ordering::Equal => println!("猜对了"),
        },
        Err(_f) => {
            println!("转换失败,{}", _f)
        }
    }
}
